package com.aishang.shopback_2005.controller;

import com.aishang.shopback_2005.po.Adminuser;
import com.aishang.shopback_2005.service.AdminuserService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * @author a1790
 */
@RestController
@RequestMapping("adminUser")
public class AdminUserController {
    @Resource
    private AdminuserService adminuserService;
    @Resource
    private HttpSession session;
    @RequestMapping("/login")
    public Adminuser Adminuser (@RequestBody Adminuser adminuser){
        Adminuser login = (Adminuser)adminuserService.login(adminuser);

        session.setAttribute("adminUser",login);
        return login;
    }
}
